package com.jy.rhin.support.parsing.enums;

import lombok.Getter;

/**
 * @Description: 死亡医学证明文档体部分
 * @Author: lww
 * @Date: 2022/6/21 9:44
 */
@Getter
public enum DeathElementEnum {
    /**
     * 文档头-健康档案标识
     */
    HEALTH_RECORD_ID("2.16.156.10011.1.2","healthRecordId.2","head"),

    /**
     * 文档头-住院号标识
     */
    HOSPITAL_NO_ID("2.16.156.10011.1.12","hospitalNoId.2","head"),

    /**
     * 文档体-死亡信息部分
     */
    DEATH_INFO("29548-4", "deathInfo.2", "component"),
    DEATH_INFO_DATE("DE02.01.036.00", "deathInfoDate.4", "entry"),
    DEATH_INFO_PLACE("DE02.01.034.00", "deathInfoPlace.4", "entry"),
    DEATH_INFO_HOSPITAL("DE08.10.013.00", "deathInfoHospital.4", "entry"),
    /**
     * 文档体-诊断记录部分
     */
    DIAGNOSIS_RECORD("29548-5", "diagnosisRecord.2", "component"),
    DIAGNOSIS_RECORD_CAUSE_DEATH("DE05.01.061.00", "diagnosisRecordCauseDeath.4", "entry"),
    DIAGNOSIS_RECORD_OTHER_DISEASES("DE05.01.032.00", "diagnosisRecordOtherDiseases.4", "entry"),
    DIAGNOSIS_RECORD_HIGHEST_FACILITY("DE08.10.049.00", "diagnosisRecordHighestFacility.4", "entry"),
    DIAGNOSIS_RECORD_DIAGNOSTIC_BASIS("DE05.01.043.00", "diagnosisRecordDiagnosticBasis.4", "entry"),
    DIAGNOSIS_RECORD_UNDERLYING_CAUSE("DE05.01.021.00", "diagnosisRecordUnderlyingCause.4", "entry"),
    ;

    private String code;
    private String name;
    private String type;

    private DeathElementEnum(String code, String name, String type) {
        this.code = code;
        this.name = name;
        this.type = type;
    }

    public static DeathElementEnum lookup(String name) {
        if (name == null || "".equals(name)) {
            return null;
        }
        for (DeathElementEnum value : values()) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return null;
    }

}
